﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenGraphNET.Lib;

namespace OpenGraphNET.Demo
{
    class Program
    {
        static void Main(string[] args)
        {
            //Download the open graph meta properties from a website into an OpenGraphObject
            string url = "http://www.rottentomatoes.com/m/10011268-oceans/";
            Console.WriteLine("Reading OpenGraph data for " + url);
            OpenGraphObject ogObject = OpenGraphLib.PopulateOpenGraphObject(url);

            //Loop through each meta entry and output to the console
            foreach (KeyValuePair<string, string> ogEntry in ogObject.allProperties)
            {
                Console.WriteLine(ogEntry.Key + " = " + ogEntry.Value);
            }

            Console.Write("Enter to continue...");
            Console.ReadLine();

            //Create HTML meta tags from an OpenGraphObject
            Console.WriteLine("Generating OpenGraph meta tag html...");
            string headHtml = "<head>" + OpenGraphLib.CreateOpenGraphHtml(ogObject, true) + "</head>";
            Console.WriteLine(headHtml);

            Console.Write("Enter to continue...");
            Console.ReadLine();

            //Demo of function that downloads the Schema as a string
            string ogSchema = OpenGraphLib.GetOpenGraphSchema();


        }
    }
}
